package com.zzty.txj.dao;


import com.zzty.txj.entity.Daily;
import com.zzty.txj.entity.DoDaily;
import com.zzty.txj.entity.Location;
import com.zzty.txj.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DpostMapper {

    @Select("select * from daily where id=#{id}")
    public Daily getDaily(int id);

//    @Select("Select * from daily where date=#{date}>startTime and date=#{date}<stopTime ")
//    public Integer getCount(String date);

    @Select("select * from daily where id=#{id}")
    public Daily getDaily1(Integer id);

    @Select("select * from location where id=#{id}")
    public Location getLocation(Integer id);

    @Update("update doDaily set result=1 where dailyId=#{dailyId} and date=#{date} and userId=#{userId}")
    public Integer getCount(DoDaily doDaily);

    @Select("select * from doDaily where userId=#{userId} and date=#{date}")
    public List<DoDaily> getDoDaily(DoDaily doDaily);


}
